using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;

    public partial class xLitePlayer : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected string makeFilmStrip()
        {
            DataSet dsClips = this.getRecentMedia();
            StringBuilder strXamlImages = new StringBuilder();
            int canvasTop = 5;
            //<Image Source="media/images/thumb7.jpg" x:Name="NOT.wmv" Width="100" Height="100" Canvas.Top="5" Canvas.Left="8" Opacity=".5" MouseLeftButtonDown="getMovie" MouseEnter="doGlowClip" MouseLeave="undoGlowClip" />

            for (int i = 0; i < dsClips.Tables[0].Rows.Count; i++)
            {
                strXamlImages.Append(string.Format("<Image Source=\"{0}\" Tag=\"{3}\" x:Name=\"{1}\" Width=\"100\" Height=\"100\" Canvas.Top=\"{2}\" Canvas.Left=\"8\" Opacity=\".5\" MouseLeftButtonDown=\"getMovie\" MouseEnter=\"doGlowClip\" MouseLeave=\"undoGlowClip\" />", dsClips.Tables[0].Rows[i]["image"].ToString(), dsClips.Tables[0].Rows[i]["path"].ToString(), canvasTop, dsClips.Tables[0].Rows[i]["id"].ToString()));
                canvasTop += 105;
            }

            return strXamlImages.ToString();
        }

        private DataSet getRecentMedia()
        {
            DataSet tmpDs = new DataSet();

            try
            {
                tmpDs.ReadXml(Server.MapPath("~/xLitePlayer_data/xMediaPaths.xml"));
            }
            catch (Exception)
            {
                //TODO throw error;   
            }

            return tmpDs;
        }
    }
